﻿import QtQuick 2.0
import "../components"

Item {
    anchors.fill: parent
//    Connections {
//        target: MACO // 假设myCppObject是在C++中创建并注册到QML的对象
//        onrgdataReady: {
//            temp.setText(data)
//        }
//    }
    Connections{  // qmlre
        target: MACO
        onRgwd:{
            temp1.setText(temp);
        }
    }
    Row{
        spacing: 10*dp
        LineEditor{
            id : temp1
            title: "温度(°C)"
            douflag: true
        }
        PushButton{
            title: "读取"
            defaultMode2: true
            onReleased: {
                MACO.rgwdr()
            }
        }
        PushButton{
            title: "停止"
            defaultMode2: true
            onReleased: {
                MACO.rgwdrs()
            }
        }
        PushButton{
            title: "设置"
            defaultMode2: true
            onReleased: {
                MACO.rgwds(temp1.getText())
            }
        }
    }

}
